package com.pm.web.controller.projectManage;


import com.pm.common.annotation.Log;
import com.pm.common.core.controller.BaseController;
import com.pm.common.core.domain.AjaxResult;
import com.pm.common.core.page.TableDataInfo;
import com.pm.common.enums.BusinessType;
import com.pm.common.enums.ProjectListStatusEnum;
import com.pm.project.domain.ProjectList;
import com.pm.project.domain.ProjectManagerMember;
import com.pm.project.domain.vo.ProjectListVO;
import com.pm.project.domain.vo.ProjectManagerMemberVO;
import com.pm.project.service.ProjectManagerMemberService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 项目经理团队成员
 */
@RestController
@RequestMapping("/project/manager")
public class ProjectManagerMemberController extends BaseController {

    @Resource
    ProjectManagerMemberService projectManagerMemberService;



    @GetMapping("/list")
    @Log(title = "项目成员:查询团队成员",businessType = BusinessType.OTHER)
    public AjaxResult list(ProjectManagerMemberVO projectManagerMemberVO)
    {
        List<ProjectManagerMember> list = projectManagerMemberService.list(projectManagerMemberVO);
        return  success(list);
    }


    @Log(title = "项目成员:保存成员",businessType = BusinessType.INSERT)
    @PostMapping("/save")
    @PreAuthorize("@ss.hasPermi('projectManage:member:save')")
    public AjaxResult save(@RequestBody List<ProjectManagerMember> list){
        return projectManagerMemberService.save(list);
    }
}
